@extends('frontend::layout')

@section('title', '学生列表')

@section('content')
    <div class="card border-no">
        <div class="card-body">
            @if(!empty($currentUser))
            <div class="row">
                <div class="clearfix"></div>
                <div class="col-md-12 col-sm-12 col-xs-12 pull-right">
                    <p>
                        <a href="{{ route('wechat.child.add') }}" class="btn btn-primary btn-sm">添加学生</a>
                    </p>
                </div>
            </div>
            @endif
                <form method="get">
                    <div class="row">
                        <div class="clearfix"></div>
                        <div class="col-md-12 col-sm-12 col-xs-12">
                            <label class="col-md-2 col-sm-12">
                                <input class="form-control" type="text" placeholder="{{__("Username")}}" name="child_name" value="{{ old("child_name") ?: (isset($query['child_name']) ? $query['child_name'] : '') }}" />
                            </label>
                            <label class="col-md-2 col-sm-12">
                                <button class="btn btn-primary btn-sm">搜索</button>
                            </label>
                        </div>
                    </div>
                </form>
            <!--<h4 class="text-black f-20">学生列表-{{ $user->name }}</h4>-->
            <div class="table-responsive">
                <table class="table table-hover">
                    <thead>
                    <tr>
                        <th scope="col">#</th>
                        <th scope="col">{{ __('Username') }}</th>
                        <th scope="col">{{ __('Sex') }}</th>
                        <th scope="col">{{ __('Options') }}</th>
                    </tr>
                    </thead>
                    <tbody>
                    @if(isset($list))
                        @foreach($list as $idx => $item)
                            <tr>
                                <th scope="row">{{ $idx + 1 }}</th>
                                <td>{{ $item->name }}</td>
                                <td>{{ $item->sex == 1 ? "男" : "女" }}</td>
                                <td>

                                        <a href="{{ route('wechat.assessment.index', ['child_id' => $item->id]) }}" class="text-error" title="评估测试">&nbsp;&nbsp;<i class="fa fa-table"></i></a>

                                        <a href="{{ route('wechat.training.child', ['child_id' => $item->id]) }}" class="text-error" title="干预训练记录">&nbsp;&nbsp;<i class="fa fa-list"></i></a>

                                        <a href="{{ route('wechat.child.view', ['id' => $item->id]) }}" class="text-primary" title="{{ __('View') }}">&nbsp;&nbsp;<i class="fa fa-eye"></i></a>

                                        <a href="{{ route('wechat.child.edit', ['id' => $item->id]) }}" class="text-info" title="{{ __('Edit') }}">&nbsp;&nbsp;<i class="fa fa-pencil"></i></a>

                                        {{--<a href="{{ route('wechat.child.delete', ['id' => $item->id]) }}" class="text-danger confirm-delete" title="{{ __('Delete') }}">&nbsp;&nbsp;<i class="fa fa-trash-o"></i></a>--}}
                                </td>
                            </tr>
                        @endforeach
                    @endif
                    </tbody>
                </table>
            </div>
            <div class="row">
                <div class="clearfix"></div>
                <div class="col-md-12 col-sm-12 col-xs-12 pull-right">
                    @if(isset($list))
                        {{ $list->links() }}
                    @endif
                </div>
            </div>
        </div>
    </div>
@stop